package com.nengchuan.eic.nceconomy.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.nengchuan.eic.nceconomy.entity.dto.SwPropertyDTO;
import com.nengchuan.eic.nceconomy.entity.po.SwPropertyData;
import com.nengchuan.eic.nceconomy.dao.SwPropertyDataMapper;
import com.nengchuan.eic.nceconomy.service.SwPropertyDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 三维属性存储 服务实现类
 * </p>
 *
 * @author luoping
 * @since 2020-05-07
 */
@Service
public class SwPropertyDataServiceImpl extends ServiceImpl<SwPropertyDataMapper, SwPropertyData> implements SwPropertyDataService {

    @Autowired
    private SwPropertyDataMapper swPropertyDataMapper;

    @Override
    public String insertOrUpdateData(SwPropertyDTO swPropertyData) {
        SwPropertyData po=new SwPropertyData();
        BeanUtils.copyProperties(swPropertyData,po);
        if(swPropertyData.getId()==null){
            swPropertyDataMapper.insert(po);
        }else {
            swPropertyDataMapper.updatePo(po);
        }
        return "成功";
    }
}
